<?php $this->load->helper(array('form','form_formater'));?>
<div id="AuthRegisterForm" class="dlForm">
    <h2>Registration Form</h2>
<?php
//echo"<pre>";
////print_r($this->validation->_error_array);
////print_r($this->validation->_rules);
////print_r($this->validation->_fields);
////print_r($this->validation->_error_messages);
//echo "</pre>";
echo "<div class='error'>".$this->validation->error_string."</div>";

$attributes = array('id' => 'RegisterForm');
echo form_open('auth/register',$attributes);

$fields = array(
        "username"=>array('title'=>'Username'),
        "password"=>array('title'=>'Password'),
        "password2"=>array('title'=>'Confirm Password'),
        "email"=>array('title'=>'Email'),
        "question"=>array('title'=>"Secret Question"),
        "answer"=>array('title'=>"Answer"),
    );
foreach($fields as $fld=>$attr) {
  echo form_row(form_label($attr['title'],$fld),form_input($fld));
}

echo form_row('&nbsp;',form_submit('submit','Register Now'));
?>

<?php echo form_close(); ?>
</div>
